import type {
  ConsultPayParams,
  GetPatientConsultOrderPreData,
  GetPatientConsultOrderPreParams,
} from '@/types/OrderPre'
import type { GetPatientMylistItem } from '@/types/patient'
import { request } from '@/utils/request'

/**
 * 获取医生服务费信息
 * @param params
 * @returns
 */
export const getPatientConsultOrderPreAPI = (params: GetPatientConsultOrderPreParams) => {
  return request<GetPatientConsultOrderPreData>('/patient/consult/order/pre', 'GET', params)
}

/**
 * 获取患者信息
 * @param id 患者 id
 * @returns 返回患者详情
 */
export const getPatientInfoByIdAPI = (id: string) => {
  return request<GetPatientMylistItem>(`/patient/info/${id}`)
}

/**
 * 三方支付（暂时只支持支付宝支付）
 */
export const postPatientConsultPayApi = (data: ConsultPayParams) => {
  return request<{ payUrl: string }>('/patient/consult/pay', 'POST', data)
}

// /**
//  * 药品预付订单
//  */
// export const getPatientMedicineOrderPre = (prescriptionId: string) => {
//   return request<OrderPre>('/patient/medicine/order/pre', 'GET', { prescriptionId })
// }
